3.10 \(\int \frac{(c+d \sec (e+f x))^3}{a+b \cos (e+f x)} \, dx\)

Optimal. Leaf size=170 \[ \frac{d \left (3 a^2 c^2-3 a b c d+b^2 d^2\right ) \tanh ^{-1}(\sin (e+f x))}{a^3 f}+\frac{d^2 (3 a c-b d) \tan (e+f x)}{a^2 f}+\frac{2 (a c-b d)^3 \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{a+b}}\right )}{a^3 f \sqrt{a-b} \sqrt{a+b}}+\frac{d^3 \tanh ^{-1}(\sin (e+f x))}{2 a f}+\frac{d^3 \tan (e+f x) \sec (e+f x)}{2 a f} \]

[Out]

(2*(a*c - b*d)^3*ArcTan[(Sqrt[a - b]*Tan[(e + f*x)/2])/Sqrt[a + b]])/(a^3*Sqrt[a - b]*Sqrt[a + b]*f) + (d^3*Ar
cTanh[Sin[e + f*x]])/(2*a*f) + (d*(3*a^2*c^2 - 3*a*b*c*d + b^2*d^2)*ArcTanh[Sin[e + f*x]])/(a^3*f) + (d^2*(3*a
*c - b*d)*Tan[e + f*x])/(a^2*f) + (d^3*Sec[e + f*x]*Tan[e + f*x])/(2*a*f)

________________________________________________________________________________________

Rubi [A]  time = 0.326846, antiderivative size = 170, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 8, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.32, Rules used = {2828, 2952, 2659, 205, 3770, 3767, 8, 3768} \[ \frac{d \left (3 a^2 c^2-3 a b c d+b^2 d^2\right ) \tanh ^{-1}(\sin (e+f x))}{a^3 f}+\frac{d^2 (3 a c-b d) \tan (e+f x)}{a^2 f}+\frac{2 (a c-b d)^3 \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{a+b}}\right )}{a^3 f \sqrt{a-b} \sqrt{a+b}}+\frac{d^3 \tanh ^{-1}(\sin (e+f x))}{2 a f}+\frac{d^3 \tan (e+f x) \sec (e+f x)}{2 a f} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*Sec[e + f*x])^3/(a + b*Cos[e + f*x]),x]

[Out]

(2*(a*c - b*d)^3*ArcTan[(Sqrt[a - b]*Tan[(e + f*x)/2])/Sqrt[a + b]])/(a^3*Sqrt[a - b]*Sqrt[a + b]*f) + (d^3*Ar
cTanh[Sin[e + f*x]])/(2*a*f) + (d*(3*a^2*c^2 - 3*a*b*c*d + b^2*d^2)*ArcTanh[Sin[e + f*x]])/(a^3*f) + (d^2*(3*a
*c - b*d)*Tan[e + f*x])/(a^2*f) + (d^3*Sec[e + f*x]*Tan[e + f*x])/(2*a*f)

Rule 2828

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> In
t[((a + b*Sin[e + f*x])^m*(d + c*Sin[e + f*x])^n)/Sin[e + f*x]^n, x] /; FreeQ[{a, b, c, d, e, f, m}, x] && Int
egerQ[n]

Rule 2952

Int[((g_.)*sin[(e_.) + (f_.)*(x_)])^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) +
 (f_.)*(x_)])^(n_), x_Symbol] :> Int[ExpandTrig[(g*sin[e + f*x])^p*(a + b*sin[e + f*x])^m*(c + d*sin[e + f*x])
^n, x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && NeQ[b*c - a*d, 0] && (IntegersQ[m, n] || IntegersQ[m, p
] || IntegersQ[n, p]) && NeQ[p, 2]

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3768

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Csc[c + d*x])^(n - 1))/(d*(n -
 1)), x] + Dist[(b^2*(n - 2))/(n - 1), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1
] && IntegerQ[2*n]

Rubi steps

\begin{align*} \int \frac{(c+d \sec (e+f x))^3}{a+b \cos (e+f x)} \, dx &=\int \frac{(d+c \cos (e+f x))^3 \sec ^3(e+f x)}{a+b \cos (e+f x)} \, dx\\ &=\int \left (\frac{(a c-b d)^3}{a^3 (a+b \cos (e+f x))}+\frac{d \left (3 a^2 c^2-3 a b c d+b^2 d^2\right ) \sec (e+f x)}{a^3}+\frac{d^2 (3 a c-b d) \sec ^2(e+f x)}{a^2}+\frac{d^3 \sec ^3(e+f x)}{a}\right ) \, dx\\ &=\frac{d^3 \int \sec ^3(e+f x) \, dx}{a}+\frac{(a c-b d)^3 \int \frac{1}{a+b \cos (e+f x)} \, dx}{a^3}+\frac{\left (d^2 (3 a c-b d)\right ) \int \sec ^2(e+f x) \, dx}{a^2}+\frac{\left (d \left (3 a^2 c^2-3 a b c d+b^2 d^2\right )\right ) \int \sec (e+f x) \, dx}{a^3}\\ &=\frac{d \left (3 a^2 c^2-3 a b c d+b^2 d^2\right ) \tanh ^{-1}(\sin (e+f x))}{a^3 f}+\frac{d^3 \sec (e+f x) \tan (e+f x)}{2 a f}+\frac{d^3 \int \sec (e+f x) \, dx}{2 a}+\frac{\left (2 (a c-b d)^3\right ) \operatorname{Subst}\left (\int \frac{1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac{1}{2} (e+f x)\right )\right )}{a^3 f}-\frac{\left (d^2 (3 a c-b d)\right ) \operatorname{Subst}(\int 1 \, dx,x,-\tan (e+f x))}{a^2 f}\\ &=\frac{2 (a c-b d)^3 \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{a+b}}\right )}{a^3 \sqrt{a-b} \sqrt{a+b} f}+\frac{d^3 \tanh ^{-1}(\sin (e+f x))}{2 a f}+\frac{d \left (3 a^2 c^2-3 a b c d+b^2 d^2\right ) \tanh ^{-1}(\sin (e+f x))}{a^3 f}+\frac{d^2 (3 a c-b d) \tan (e+f x)}{a^2 f}+\frac{d^3 \sec (e+f x) \tan (e+f x)}{2 a f}\\ \end{align*}

Mathematica [A]  time = 1.19103, size = 335, normalized size = 1.97 \[ \frac{-2 d \left (a^2 \left (6 c^2+d^2\right )-6 a b c d+2 b^2 d^2\right ) \log \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )+2 d \left (a^2 \left (6 c^2+d^2\right )-6 a b c d+2 b^2 d^2\right ) \log \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )-\frac{8 (a c-b d)^3 \tanh ^{-1}\left (\frac{(a-b) \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{b^2-a^2}}\right )}{\sqrt{b^2-a^2}}+\frac{a^2 d^3}{\left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )^2}-\frac{a^2 d^3}{\left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )^2}+\frac{4 a d^2 (3 a c-b d) \sin \left (\frac{1}{2} (e+f x)\right )}{\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )}+\frac{4 a d^2 (3 a c-b d) \sin \left (\frac{1}{2} (e+f x)\right )}{\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )}}{4 a^3 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(c + d*Sec[e + f*x])^3/(a + b*Cos[e + f*x]),x]

[Out]

((-8*(a*c - b*d)^3*ArcTanh[((a - b)*Tan[(e + f*x)/2])/Sqrt[-a^2 + b^2]])/Sqrt[-a^2 + b^2] - 2*d*(-6*a*b*c*d +
2*b^2*d^2 + a^2*(6*c^2 + d^2))*Log[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]] + 2*d*(-6*a*b*c*d + 2*b^2*d^2 + a^2*(6
*c^2 + d^2))*Log[Cos[(e + f*x)/2] + Sin[(e + f*x)/2]] + (a^2*d^3)/(Cos[(e + f*x)/2] - Sin[(e + f*x)/2])^2 + (4
*a*d^2*(3*a*c - b*d)*Sin[(e + f*x)/2])/(Cos[(e + f*x)/2] - Sin[(e + f*x)/2]) - (a^2*d^3)/(Cos[(e + f*x)/2] + S
in[(e + f*x)/2])^2 + (4*a*d^2*(3*a*c - b*d)*Sin[(e + f*x)/2])/(Cos[(e + f*x)/2] + Sin[(e + f*x)/2]))/(4*a^3*f)

________________________________________________________________________________________

Maple [B]  time = 0.074, size = 593, normalized size = 3.5 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*sec(f*x+e))^3/(a+b*cos(f*x+e)),x)

[Out]

-1/2/f*d^3/a/(tan(1/2*f*x+1/2*e)+1)^2+3/f*d/a*ln(tan(1/2*f*x+1/2*e)+1)*c^2+1/2/f*d^3/a*ln(tan(1/2*f*x+1/2*e)+1
)-3/f*d^2/a^2*ln(tan(1/2*f*x+1/2*e)+1)*b*c+1/f*d^3/a^3*ln(tan(1/2*f*x+1/2*e)+1)*b^2-3/f*d^2/a/(tan(1/2*f*x+1/2
*e)+1)*c+1/2/f*d^3/a/(tan(1/2*f*x+1/2*e)+1)+1/f*d^3/a^2/(tan(1/2*f*x+1/2*e)+1)*b+1/2/f*d^3/a/(tan(1/2*f*x+1/2*
e)-1)^2-3/f*d/a*ln(tan(1/2*f*x+1/2*e)-1)*c^2-1/2/f*d^3/a*ln(tan(1/2*f*x+1/2*e)-1)+3/f*d^2/a^2*ln(tan(1/2*f*x+1
/2*e)-1)*b*c-1/f*d^3/a^3*ln(tan(1/2*f*x+1/2*e)-1)*b^2-3/f*d^2/a/(tan(1/2*f*x+1/2*e)-1)*c+1/2/f*d^3/a/(tan(1/2*
f*x+1/2*e)-1)+1/f*d^3/a^2/(tan(1/2*f*x+1/2*e)-1)*b+2/f/((a+b)*(a-b))^(1/2)*arctan((a-b)*tan(1/2*f*x+1/2*e)/((a
+b)*(a-b))^(1/2))*c^3-6/f/a/((a+b)*(a-b))^(1/2)*arctan((a-b)*tan(1/2*f*x+1/2*e)/((a+b)*(a-b))^(1/2))*b*c^2*d+6
/f/a^2/((a+b)*(a-b))^(1/2)*arctan((a-b)*tan(1/2*f*x+1/2*e)/((a+b)*(a-b))^(1/2))*b^2*c*d^2-2/f/a^3/((a+b)*(a-b)
)^(1/2)*arctan((a-b)*tan(1/2*f*x+1/2*e)/((a+b)*(a-b))^(1/2))*b^3*d^3

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sec(f*x+e))^3/(a+b*cos(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sec(f*x+e))^3/(a+b*cos(f*x+e)),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (c + d \sec{\left (e + f x \right )}\right )^{3}}{a + b \cos{\left (e + f x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sec(f*x+e))**3/(a+b*cos(f*x+e)),x)

[Out]

Integral((c + d*sec(e + f*x))**3/(a + b*cos(e + f*x)), x)

________________________________________________________________________________________

Giac [B]  time = 1.24752, size = 475, normalized size = 2.79 \begin{align*} \frac{\frac{{\left (6 \, a^{2} c^{2} d - 6 \, a b c d^{2} + a^{2} d^{3} + 2 \, b^{2} d^{3}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right )}{a^{3}} - \frac{{\left (6 \, a^{2} c^{2} d - 6 \, a b c d^{2} + a^{2} d^{3} + 2 \, b^{2} d^{3}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right )}{a^{3}} - \frac{4 \,{\left (a^{3} c^{3} - 3 \, a^{2} b c^{2} d + 3 \, a b^{2} c d^{2} - b^{3} d^{3}\right )}{\left (\pi \left \lfloor \frac{f x + e}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac{a \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - b \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{\sqrt{a^{2} - b^{2}}}\right )\right )}}{\sqrt{a^{2} - b^{2}} a^{3}} - \frac{2 \,{\left (6 \, a c d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - a d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 2 \, b d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 6 \, a c d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - a d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 2 \, b d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )\right )}}{{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 1\right )}^{2} a^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sec(f*x+e))^3/(a+b*cos(f*x+e)),x, algorithm="giac")

[Out]

1/2*((6*a^2*c^2*d - 6*a*b*c*d^2 + a^2*d^3 + 2*b^2*d^3)*log(abs(tan(1/2*f*x + 1/2*e) + 1))/a^3 - (6*a^2*c^2*d -
 6*a*b*c*d^2 + a^2*d^3 + 2*b^2*d^3)*log(abs(tan(1/2*f*x + 1/2*e) - 1))/a^3 - 4*(a^3*c^3 - 3*a^2*b*c^2*d + 3*a*
b^2*c*d^2 - b^3*d^3)*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(-2*a + 2*b) + arctan(-(a*tan(1/2*f*x + 1/2*e) - b*t
an(1/2*f*x + 1/2*e))/sqrt(a^2 - b^2)))/(sqrt(a^2 - b^2)*a^3) - 2*(6*a*c*d^2*tan(1/2*f*x + 1/2*e)^3 - a*d^3*tan
(1/2*f*x + 1/2*e)^3 - 2*b*d^3*tan(1/2*f*x + 1/2*e)^3 - 6*a*c*d^2*tan(1/2*f*x + 1/2*e) - a*d^3*tan(1/2*f*x + 1/
2*e) + 2*b*d^3*tan(1/2*f*x + 1/2*e))/((tan(1/2*f*x + 1/2*e)^2 - 1)^2*a^2))/f